Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement errors.PrettyPrinter for decoding errors #518

Closed
wants to merge 1 commit into from

Conversation

waterfountain1996
Copy link

This PR is supposed to fix #517 by implementing errors.PrettyPrinter interface for decoding errors.

Looking at the source code, the err struct fields seems to always be *yaml.syntaxError, however it doesn't feel quite right to check for underlying errors' implementation of PrettyPrinter and falling back to printing the error message. Perhaps putting the msg and the token into the struct explicitly would be better.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 78.91%. Comparing base (8f36c1b) to head (c8182b8).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
- Coverage   79.09%   78.91%   -0.19%     
==========================================
  Files          17       17              
  Lines        6110     6124      +14     
==========================================
  Hits         4833     4833              
- Misses        965      979      +14     
  Partials      312      312              

@goccy
Copy link
Owner

goccy commented Nov 14, 2024

I've supported this feature with #535 . Thank you for your contribution !

@goccy goccy closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FormatError unexpectedly includes source
3 participants